package com.new_wear.project.category.category.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.new_wear.project.category.category.mapper.CstCategoryMapper;
import com.new_wear.project.category.category.domain.CstCategory;
import com.new_wear.project.category.category.service.ICstCategoryService;
import com.new_wear.common.utils.text.Convert;

/**
 * 栏目Service业务层处理
 * 
 * @author new_wear
 * @date 2019-12-30
 */
@Service
public class CstCategoryServiceImpl implements ICstCategoryService 
{
    @Autowired
    private CstCategoryMapper cstCategoryMapper;

    /**
     * 查询栏目
     * 
     * @param id 栏目ID
     * @return 栏目
     */
    @Override
    public CstCategory selectCstCategoryById(Integer id)
    {
        return cstCategoryMapper.selectCstCategoryById(id);
    }

    /**
     * 查询栏目列表
     * 
     * @param cstCategory 栏目
     * @return 栏目
     */
    @Override
    public List<CstCategory> selectCstCategoryList(CstCategory cstCategory)
    {
        return cstCategoryMapper.selectCstCategoryList(cstCategory);
    }

    /**
     * 新增栏目
     * 
     * @param cstCategory 栏目
     * @return 结果
     */
    @Override
    public int insertCstCategory(CstCategory cstCategory)
    {
        return cstCategoryMapper.insertCstCategory(cstCategory);
    }

    /**
     * 修改栏目
     * 
     * @param cstCategory 栏目
     * @return 结果
     */
    @Override
    public int updateCstCategory(CstCategory cstCategory)
    {
        return cstCategoryMapper.updateCstCategory(cstCategory);
    }

    /**
     * 删除栏目对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteCstCategoryByIds(String ids)
    {
        return cstCategoryMapper.deleteCstCategoryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除栏目信息
     * 
     * @param id 栏目ID
     * @return 结果
     */
    @Override
    public int deleteCstCategoryById(Integer id)
    {
        return cstCategoryMapper.deleteCstCategoryById(id);
    }
}
